# a concrete Backup implementation for backing up del.icio.us data
class DeliciousBackup < Backup
  attr_meta :username, :password
  validates_presence_of :username, :password
  belongs_to :user # incase this needs to be here ... shouldn't need to be tho!

  def run
    xml = get 'http://del.icio.us/api/posts/all', :http_basic_authentication => [username, password]
    write output_path, xml
  end

  def output_path
    @output_path ||= "#{ id }-delicious-#{ username }"
  end
end
